﻿using FreeSql;
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZoneLineNew.Enums;
using ZoneLineNew.Models.Entity.Base;

namespace ZoneLineNew.Models.Entity.Template {

    [Table(Name = "base_template_params_dtl")]
    public class ParamsEntity : EntityBase {

		private string _paramsName;
        /// <summary>
        /// 参数名称
        /// </summary>
		public string ParamsName {
			get { return _paramsName; }
			set { _paramsName = value; base.RaisePropertyChanged(); }
		}

        private bool _isTempParams = false;
        /// <summary>
        /// 是否是模板数据源参数
        /// </summary>
        [Column(MapType = typeof(bool))]
        public bool IsTempParams {
            get { return _isTempParams; }
            set { _isTempParams = value; base.RaisePropertyChanged(); }
        }

        private string _paramsKey;
        /// <summary>
        /// 参数Key，如果是模板数据源参数，请务必模板中设置的数据源名称保持一致
        /// </summary>
        public string ParamsKey {
            get { return _paramsKey; }
            set { _paramsKey = value; base.RaisePropertyChanged(); }
        }

        private eParamType? _paramsType;
        /// <summary>
        /// 参数类型
        /// </summary>
        [Column(MapType =  typeof(int))]
        public eParamType? ParamsType {
            get { return _paramsType; }
            set { _paramsType = value; base.RaisePropertyChanged(); }
        }


        private long _viewTableID;
        /// <summary>
        /// 对照表ID
        /// </summary>
        public long ViewTableID {
            get { return _viewTableID; }
            set { _viewTableID = value; base.RaisePropertyChanged(); }
        }

        private int _length = 1;
        /// <summary>
        /// 参数长度
        /// </summary>
        public int Length {
            get { return _length; }
            set { _length = value; base.RaisePropertyChanged(); }
        }

        private eValueType? _valueType;
        /// <summary>
        /// 参数值类型
        /// </summary>
        [Column(MapType = typeof(int))]
        public eValueType? ValueType {
            get { return _valueType; }
            set { _valueType = value; base.RaisePropertyChanged(); }
        }

        private bool? _isAccumulatedByDay = false;
        /// <summary>
        /// 是否按天累计
        /// </summary>
        [Column(MapType = typeof(bool))]
        public bool? IsAccumulatedByDay {
            get { return _isAccumulatedByDay; }
            set { _isAccumulatedByDay = value; base.RaisePropertyChanged(); }
        }


        private string _value;
        /// <summary>
        /// 参数值
        /// </summary>
        public string Value {
            get { return _value; }
            set { _value = value; base.RaisePropertyChanged(); }
        }


        private int _sort = 1;
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort {
            get { return _sort; }
            set { _sort = value; base.RaisePropertyChanged(); }
        }

        private bool _isQrCodeField = true;
        /// <summary>
        /// 是否二维码字段
        /// </summary>
        public bool IsQrCodeField {
            get { return _isQrCodeField; }
            set { _isQrCodeField = value; base.RaisePropertyChanged(); }
        }

        private long _templateID;
        /// <summary>
        /// 模板ID
        /// </summary>
        public long TemplateID {
            get { return _templateID; }
            set { _templateID = value; base.RaisePropertyChanged(); }
        }

    }
}
